<template>
  <view class="baseTab" :style="{ width }">
    <u-tabs class="defaultStyle"
      :name="name"
      :is-scroll="isScroll"
      :list="list"
      :height="height"
      :current="current"
      :show-bar="isShowBar"
      font-size="28"
      active-color="#0EADE2"
      inactive-color="#333333"
      bg-color="#fff"
      bold="true"
      @change="change"
    ></u-tabs>
  </view>
</template>

<script>
export default {
  name: "BaseTabs",
  props: {
    width: { type: String, default: "100%" },
    height: { type: String | Number, default: "60" },
    isScroll: { type: Boolean, default: false },
    name:{type:String,default:'name'},
    list: {
      type: Array,
      default: [
        // {
        //   name: "今日",
        //   status: 0,
        // },
        // {
        //   name: "昨日",
        //   status: 1,
        // },
      ],
    },
    isShowBar: { type: Boolean, default: false },
    current:{type:Number,default:0}
  },
  data() {
    return {
      // current: 0,
    };
  },
  methods: {
    change(e) {
      // this.current = e;
      console.log('点击信息',this.list[e])
      this.$emit("change", e, this.list[e]);
    },
  },
};
</script>

<style lang="scss" scoped>
.baseTab {
  width: 100%;
  flex: 1;
  
}
.defaultStyle{
  ::v-deep .u-tab-item {
    border: 1px solid #000 !important;
    // color: red !important;
  }
} 
</style>